'''
Created on 31-05-2012

@author: Magda
'''


import pyodbc


class Category(object):
    '''
    classdocs
    '''

    def save(self):
        conn = pyodbc.connect('DRIVER={SQL Server};SERVER=MAGDAK\SQLEXPRESS;DATABASE=Baza;Trusted_Connection=yes')
        cur = conn.cursor()
        cur.execute("exec addCategory ?",self.name)
        conn.commit()
        conn.close()
        

    def __init__(self, name):
        '''
        Constructor
        '''
        self.name = name
        
kategoria = Category("Produkty spozywcze")
kategoria.save()